import { reqCageDetail } from '@/api/index.js';
const state = {
	cageNum: [],
};
const mutations = {
	GETCAGENUM(state, val) {
		state.cageNum = val;
	},
};
const actions = {
	async SETCAGENUM({ commit }, val) {
		const res = reqCageDetail(val);
		res.then((response) => {
		    // console.log(response);
			commit('GETCAGENUM', response.cages);
			uni.stopPullDownRefresh();
		}).catch((error) => {
		    console.error("An error occurred:", error);
		});
	},
};

export default {
	state,
	mutations,
	actions,
};
